package com.b2c.ftysys.view.application.fileImport;

import java.io.IOException;
import java.io.InputStream;
import java.util.HashMap;
import java.util.Map;
import java.util.Properties;

import org.springframework.stereotype.Component;

import com.b2c.ftysys.view.application.AppErrorException;
import com.b2c.ftysys.view.application.ApplicationConstants;

@Component(value="staffFileImportor")
public class StaffFileImportor extends FileImportor implements FileImport {

	@Override
	public Map<String, String> getPropertyMap() throws AppErrorException {
		InputStream inputStream = this.getClass().getClassLoader()
				.getResourceAsStream(ApplicationConstants.STAFF_EXCEL_FILE_PRO);
		Properties p = new Properties();
		try {
			p.load(inputStream);
		} catch (IOException e1) {
			throw new AppErrorException("读取 STAFF_EXCEL_FILE_PRO 配置文件出错!");
		}

		Map<String, String> propertyMap = new HashMap<String, String>();
		for (Object key : p.keySet()) {
			propertyMap.put((String) key, (String) p.get(key));
		}
		return propertyMap;
	}

}
